package com.jzo2o.customer.controller.operation;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.request.CertificationAuditReqDTO;
import com.jzo2o.customer.model.dto.response.AgencyCertificationAuditResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditService;
import com.jzo2o.customer.service.IAgencyCertificationService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 管理端认证信息相关接口
 * @author itcast
 */
@RestController("operationAgencyCertificationAuditController")
@RequestMapping("/operation/agency-certification-audit")
@Api(tags = "管理端 - 机构认证信息相关接口")
public class AgencyCertificationAuditController {

@Resource
private IAgencyCertificationService agencyCertificationService;


@Resource
private IAgencyCertificationAuditService agencyCertificationAuditService;

    /**
     * 分页查询认证信息
     * @return
     */
    @GetMapping("/page")
    public PageResult<AgencyCertificationAuditResDTO> pageQuery(AgencyCertificationAuditPageQueryReqDTO agencyCertificationAuditPageQueryReqDTO) {
     return agencyCertificationService.pageQuery(agencyCertificationAuditPageQueryReqDTO);

    }


    @PutMapping("/audit/{id}")
    public void AduitAgencyCertification(@PathVariable("id") Long id,
                                         @RequestBody CertificationAuditReqDTO certificationAuditReqDTO) {
       agencyCertificationAuditService.AduitAgencyCertificationAudit(id, certificationAuditReqDTO);
    }


}
